/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.landmark;

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.JComponent;
import javax.swing.JFrame;

/**
 *
 * @author computer
 */
public class UniformMarketHome extends JFrame {

    /**
     * Creates new form UniformMarketHome
     */
    public UniformMarketHome() {
        //initComponents();   
        super("Uniform Market");
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                createAndShowGUI();
            }
        });        
    }
    
    /**
     * Create the GUI and show it. As with all GUI code, this must run
     * on the event-dispatching thread.
     */
    private void createAndShowGUI() {        
        //Create and set up the window.        
        Toolkit theKit = getToolkit(); // Get the window toolkit
        Dimension wndSize = theKit.getScreenSize();
        int width = wndSize.width;
        int height = wndSize.height;
        
        //setSize(width,height);
        //setBounds(0,0,0,0);
        //setPreferredSize(new Dimension(800,600));
        setBounds(250, 50, // Position
				800, 600); // Size                
//        setLocationRelativeTo(this);
//        setResizable(false);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//        setLayout(new BorderLayout());
        
        //Create and set up the content pane.
        JComponent newContentPane = new MainPanel();
        Util.getHelperBean().setMainPanelWidth(width);
        Util.getHelperBean().setMainPanelHeight(height);
        newContentPane.setOpaque(true); //content panes must be opaque
        add(newContentPane, BorderLayout.CENTER);
        //setContentPane(newContentPane);
        
        //Display the window.
        pack();
        setVisible(true);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Uniform Market");
        setPreferredSize(new java.awt.Dimension(800, 600));

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-416)/2, (screenSize.height-338)/2, 416, 338);
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        new UniformMarketHome();
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    
}


